<template>
	<view id="page">
		<nav-bar :navH="navH" :isTabar="false" :isHome="false" :pageName="title"></nav-bar>
		<view class="help">
			<text class='title'>{{detail.question}}</text>
			<view class='section detail-cont'>
				<rich-text :nodes="detail.answer"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import app from '../../common/index.js'
	export default {
		data() {
			return {
				title: '帮助详情',
				navH: null,
				detail: {}
			}
		},
		onLoad(options) {
			this.navH = this.$store.state.navHeight;
			this.getDetail(options.id)
		},
		// 下拉刷新
		onPullDownRefresh() {
			this.getDetail();
			uni.stopPullDownRefresh();
		},
		// 分享转发
		onShareAppMessage() {
			return {
				title: '爱美指南针',
				path: 'pages/index/index',
			}
		},
		methods: {
			/**
			 * @des 获取详情
			 */
			getDetail(hid) {
				app.request({
					url: 'entry/wxapp/HelpDetail',
					data: {id: hid}
				}, (ret) => {
					let d = ret.data;
					this.detail = d;
				})
			} 
		}
	}
</script>

<style>
	.help {padding: 0 20upx; border-bottom: 1px solid #eee;}
	.help .title {display: block; width: 100%; padding: 30upx 0 20upx; text-align: left; font-size: 30upx;}
	.detail-cont {margin-top: 0; padding: 20upx; border-radius: 4px; background-color: #fff; color: #666;}
</style>